<template>
  <div class="mod-config">
    <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
      
      <el-form-item>
        <el-input v-model="dataForm.resExpectedOccupation" placeholder="岗位名称" clearable></el-input>
      </el-form-item>
      <el-form-item>
        <el-button @click="getDataList()">查询</el-button>
        
      </el-form-item>
    </el-form>
     <div v-for="data of dataList" :key="data.resId">
    <div class="main" >
        <el-row >
          <el-col :span="4">
            <div style="margin-top:30px">
              
              <p>分享人：{{data.username}}</p>
              <p>分享时间:{{data.shaTime}}</p>
            </div>
          </el-col>
          <el-col :span="8">
            <div style="margin-top:20px">
              <p>{{data.resName}}&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;{{data.resAge}}岁&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;{{data.resGender}}</p>
              <p>{{data.resExpectedOccupation}}&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;{{data.resExpectedArea}}  </p>
              <p>{{data.resWorkYear}}&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;{{data.resExpectedSalary}}</p>
            </div>
          </el-col>
          <el-col :span="8">
            <div style="margin-top:20px">
              <p>{{data.resEducation}}&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;{{data.resMajor}}</p>
              <p>{{data.resOutCollege}}毕业于{{data.resCollege}} </p>
              <p>录入时间：{{data.resTime}}</p>
            </div>
          </el-col>
         

          
          <el-col :span="4">
            <div style="margin-top:40px">
              
              <el-button type="text"  @click="shareResumeInfoHandle(data.resId)">简历详情</el-button>
              
            </div>
          </el-col>
        </el-row>
      
    </div>
</div>
    <!-- 弹窗, 新增 / 修改 -->
    <share-resume-info v-if="shareResumeInfoVisible" ref="shareResumeInfo" @refreshDataList="getDataList"></share-resume-info>
  </div>
</template>

<script>
  import ShareResumeInfo from './share-resume-info'
  export default {
    data () {
      return {
        dataForm: {
          resExpectedOccupation: ''
        },
        dataList: [],
       
        dataListLoading: false,
        
        shareResumeInfoVisible: false
      }
    },
    components: {
      ShareResumeInfo
    },
    activated () {
      this.getDataList()
    },
    methods: {
      // 获取数据列表
      getDataList () {
        this.dataListLoading = true
        this.$http({
          url: this.$http.adornUrl('/generator/share/friendsShareList'),
          method: 'get',
          params: this.$http.adornParams({
            'resExpectedOccupation': this.dataForm.resExpectedOccupation,
          })
        }).then(({data}) => {
          if (data && data.code === 0) {
            this.dataList = data.list
         
          } else {
            this.dataList = []
           
          }
          this.dataListLoading = false
        })
      },
     
      
      shareResumeInfoHandle (id) {
        this.shareResumeInfoVisible = true
        this.$nextTick(() => {
          this.$refs.shareResumeInfo.init(id)
        })
      },
      
    }
  }
</script>
<style>
.main {
  border: 1px dashed paleturquoise;
  width: 100%;
  height: 120px;
  text-align: center;
  margin: 10px auto;

}
</style>